/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http:  // www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef SWANLINK_FINANCE_VIRT_PRINTERADAPTOR_H
#define SWANLINK_FINANCE_VIRT_PRINTERADAPTOR_H

#include "iprinteradaptor.h"
#include <string>
#include <queue>

namespace SwanLink {
namespace Finance {

class VIRT_Adaptor:public IPrinterAdaptor
{
 public:
    VIRT_Adaptor();
    virtual ~VIRT_Adaptor();
    // 公共接口
    virtual int Open(const Transport& tran);
    virtual int Close();
    virtual bool IsOpen();
    virtual int Reset();
    virtual int GetStatus(int module, char *err);

    // 设备功能接口
    virtual int GetPrintFormat(PrintFormatType ftt);
    virtual void SetPrintFormat(PrintFormatType ftt, int value);
    virtual void GetDeviceSpec(DeviceSpec &spec);
    virtual int FeedPaper(int line);
    virtual int CutPaper(int line, int mode);
    virtual int AddText(int x, int y, const std::string& text);
    virtual int AddBitmap(int x, int y, const std::string& lpPath);
    virtual int AddQRCode(int x, int y, int w, const std::string& qr);
    virtual int AddBarCode(int x, int y, BarCodeSpec &spec, const std::string& bar);
    virtual void StartPrint(int timeout, PrintListener *listener);

 private:
    int m_iStatus;
    bool m_isOpen;
};
}  // namespace Finance
}  // namespace SwanLink
#endif  // SWANLINK_FINANCE_VIRT_PRINTERADAPTOR_H
